<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js对象dom</title>
</head>
<body>
<span id="sid">dom元素1</span>
<span class="txt">dom元素2</span>
<span class="txt">dom元素3</span>
</body>
<script>
  let s1 = document.querySelector("#sid");
  console.log(s1)
  s1.innerHTML = "修改了dom元素1"

  let s2 = document.querySelectorAll(".txt");
  s2.forEach(s => console.log(s))
</script>
</html>